<template>

    <div>
        <el-table :data="List" border style="width: 100%" height="500px">
            <el-table-column fixed prop="" label="序号" width="50">
                <template slot-scope="scope">
                    {{ scope.$index + 1 }}
                </template>
            </el-table-column>
            <el-table-column fixed prop="empid" label="员工编号" width="100"/>
            <el-table-column fixed prop="ename" label="员工名"/>
            <el-table-column fixed prop="eusername" label="登录名"/>
            <el-table-column fixed prop="epassword" label="密码" width="100"/>
            <el-table-column fixed prop="phone" label="手机号" width="100"/>
            <el-table-column fixed prop="sex" label="性别" width="200"/>
            <el-table-column fixed prop="photo" label="头像" width="200"/>
            <el-table-column fixed prop="roleid" label="角色" width="200"/>
            <el-table-column fixed prop="state" label="状态" width="60">
                <template slot-scope="scope" >
                    <span v-if="scope.row.state === 0" style="color:green">{{scope.row.state === 0?'可用':'禁用'}}</span>
                    <span v-else style="color: red">{{scope.row.state === 0?'可用':'禁用'}}</span>
                </template>
            </el-table-column>

            <el-table-column fixed="right" label="操作" width="170">
                <template slot-scope="scope">
                    <el-button type="text" @click="logFormVisible=true;form=Object.assign({},scope.row)">修改</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
export default {
    name: 'emp',
    data(){
        return{
            List:[]
        }
    },
    created() {
        this.getList();
    },
    methods:{
        getList() {
            this.$http.post('/oppo-back/emp/list?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MzA5OTQ2MjksInVzZXJfbmFtZSI6IndyIiwiYXV0aG9yaXRpZXMiOlsiZXBhc3N3b3JkPSQyYSQxMCRBUnkzN0Y5aGtBbjUualZxa1llcm5PRS93b2F2d1lZaUllcDQ0TmxFUnhMSGhSMGV5aDk2cSIsIkVtcChlbXBpZD0zIiwiZW5hbWU96Iqu6IquIiwicm9sZWlkPW51bGwiLCJwaG9uZT0xNDQyNjc4OTM0NiIsInNleD3lpbMiLCJhdXRob3JpdGllcz1udWxsKSIsImV1c2VybmFtZT13ciIsInBob3RvPW51bGwiLCJzdGF0ZT0wIl0sImp0aSI6IjI2YjViZDM2LTYxMWEtNDhiMy1iYTdhLWQ2YjAzZGRiZDQzNiIsImNsaWVudF9pZCI6Im9wcG8tYmFjayIsInNjb3BlIjpbImFsbCJdfQ.BhqPkvYq3qtdg6mzOzR89yd7ZTovvYx00MFOk6JGH_I').then(res => {
                console.log(res)
                this.$data.List = res;
            })
        }
    }
}
</script>

<style scoped>

</style>
